<div class="bg-light lter b-b wrapper-md ng-scope">
    <h4 class="m-n font-thin">模块管理</h4>
</div>
<div class="wrapper-md ng-scope" ng-controller="modulesCtrl">
    <div class="panel panel-default">
    <div class="row wrapper">
        <div class="col-sm-9">
            <form class="form-inline ng-pristine ng-valid">
                <div class="form-group">
                    <label class="control-label">模块名称</label>
                    <input type="text" class="input-sm form-control" ng-model="modulesListVO.name" placeholder="请输入模块名称">
                </div>
                <div class="form-group">
                    <label class="control-label">模块类型</label>
                    <select class="input-sm form-control" ng-model="modulesListVO.columnId">
                        <option value="">全部</option>
                        <option value="{{item.id}}" ng-repeat="item in columns">{{item.name}}</option>
                    </select>
                </div>
                <button class="btn btn-sm btn-default" ng-click="query()">查询</button>
            </form>
        </div>
        <div class="col-sm-3">
            <div class=" pull-right">
                <a class="btn btn-sm btn-info" ui-sref="app.modulesAdd" target="_blank">添加模块</a>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="table-responsive">
        <table class="table table-striped b-t b-light">
                <thead>
                    <tr>
                        <th>模块编号</th>
                        <th>模块名称</th>
                        <th>栏目类型</th>
                        <th>模块排序</th>
                        <th>商品状态</th>
                        <th width="200">操作</th>
                    </tr>
                </thead>
                <tbody>
                     <tr ng-repeat="item in list">
                        <td>{{item.code}}</td>
                        <td>{{item.name}}</td>
                        <td>{{item.columnName}}</td>
                        <td>{{item.sort}}</td>
                        <td>
                            <div>
                                <p class="inline label" ng-class="{0:'label-primary',1:'label-success'}[item.isRecommandGoods]" ng-bind="{0:'全部商品',1:'推荐商品'}[item.isRecommandGoods]"></p>
                                <p class="block h6">限制商品数:{{item.goodsQuantity}}</p>
                            </div>
                        </td>
                        <td class="t-btns">
                            <a class="btn btn-sm btn-info" ui-sref="app.modulesEdit({id:item.id})" target="_blank">修改</a>
                            <button class="btn btn-sm btn-danger" ng-click="deleteById(item.id,item.name)">删除</button>
                            <div class="btn-group dropdown" dropdown="">
                                <button class="btn btn-sm btn-default" dropdown-toggle="" aria-haspopup="true" aria-expanded="false">更多 <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="" ui-sref="app.modulesGoods({id:item.id})" target="_blank">商品管理</a></li>
                                    <li><a href="" ui-sref="app.modulesAdvertisement({modulesId:item.id})" target="_blank">广告管理</a></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                </tbody>
        </table>
        <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
            <span class="h6">~未搜索到任何数据~</span>
        </div>
        <div>
            <circle-loading ng-if="app.loading"></circle-loading>
        </div>
    </div>
    <footer class="panel-footer">
        <div class="row">
            <div class="col-sm-offset-4 col-sm-4 text-center text-center-xs">
                <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
            </div>
            <div class="col-sm-4 text-right text-center-xs">
                <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                            ng-change="pageChanged()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                            previous-text="上一页" next-text="下一页"
                            first-text="首页" last-text="尾页"></pagination>
            </div>
        </div>
    </footer>
</div>
</div>